using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace CXDB
{
	/// <summary>
	/// Strongly-typed collection for the CxProvider class.
	/// </summary>
    [Serializable]
	public partial class CxProviderCollection : ActiveList<CxProvider, CxProviderCollection>
	{	   
		public CxProviderCollection() {}
        
        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>CxProviderCollection</returns>
		public CxProviderCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                CxProvider o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }
		
		
	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the CX_Provider table.
	/// </summary>
	[Serializable]
	public partial class CxProvider : ActiveRecord<CxProvider>, IActiveRecord
	{
		#region .ctors and Default Settings
		
		public CxProvider()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}
		
		private void InitSetDefaults() { SetDefaults(); }
		
		public CxProvider(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}
        
		public CxProvider(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}
		 
		public CxProvider(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}
		
		protected static void SetSQLProps() { GetTableSchema(); }
		
		#endregion
		
		#region Schema and Query Accessor	
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}
		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("CX_Provider", TableType.Table, DataService.GetInstance("CXDB"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
				colvarId.ColumnName = "ID";
				colvarId.DataType = DbType.Int32;
				colvarId.MaxLength = 0;
				colvarId.AutoIncrement = true;
				colvarId.IsNullable = false;
				colvarId.IsPrimaryKey = true;
				colvarId.IsForeignKey = false;
				colvarId.IsReadOnly = false;
				colvarId.DefaultSetting = @"";
				colvarId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarId);
				
				TableSchema.TableColumn colvarProviderName = new TableSchema.TableColumn(schema);
				colvarProviderName.ColumnName = "ProviderName";
				colvarProviderName.DataType = DbType.String;
				colvarProviderName.MaxLength = 100;
				colvarProviderName.AutoIncrement = false;
				colvarProviderName.IsNullable = true;
				colvarProviderName.IsPrimaryKey = false;
				colvarProviderName.IsForeignKey = false;
				colvarProviderName.IsReadOnly = false;
				colvarProviderName.DefaultSetting = @"";
				colvarProviderName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProviderName);
				
				TableSchema.TableColumn colvarDeviceName = new TableSchema.TableColumn(schema);
				colvarDeviceName.ColumnName = "DeviceName";
				colvarDeviceName.DataType = DbType.String;
				colvarDeviceName.MaxLength = 100;
				colvarDeviceName.AutoIncrement = false;
				colvarDeviceName.IsNullable = true;
				colvarDeviceName.IsPrimaryKey = false;
				colvarDeviceName.IsForeignKey = false;
				colvarDeviceName.IsReadOnly = false;
				colvarDeviceName.DefaultSetting = @"";
				colvarDeviceName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeviceName);
				
				TableSchema.TableColumn colvarShamTime = new TableSchema.TableColumn(schema);
				colvarShamTime.ColumnName = "Sham_time";
				colvarShamTime.DataType = DbType.DateTime;
				colvarShamTime.MaxLength = 0;
				colvarShamTime.AutoIncrement = false;
				colvarShamTime.IsNullable = true;
				colvarShamTime.IsPrimaryKey = false;
				colvarShamTime.IsForeignKey = false;
				colvarShamTime.IsReadOnly = false;
				colvarShamTime.DefaultSetting = @"";
				colvarShamTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarShamTime);
				
				TableSchema.TableColumn colvarShamProject = new TableSchema.TableColumn(schema);
				colvarShamProject.ColumnName = "Sham_project";
				colvarShamProject.DataType = DbType.String;
				colvarShamProject.MaxLength = 100;
				colvarShamProject.AutoIncrement = false;
				colvarShamProject.IsNullable = true;
				colvarShamProject.IsPrimaryKey = false;
				colvarShamProject.IsForeignKey = false;
				colvarShamProject.IsReadOnly = false;
				colvarShamProject.DefaultSetting = @"";
				colvarShamProject.ForeignKeyTableName = "";
				schema.Columns.Add(colvarShamProject);
				
				TableSchema.TableColumn colvarShamDetail = new TableSchema.TableColumn(schema);
				colvarShamDetail.ColumnName = "Sham_detail";
				colvarShamDetail.DataType = DbType.String;
				colvarShamDetail.MaxLength = 1073741823;
				colvarShamDetail.AutoIncrement = false;
				colvarShamDetail.IsNullable = true;
				colvarShamDetail.IsPrimaryKey = false;
				colvarShamDetail.IsForeignKey = false;
				colvarShamDetail.IsReadOnly = false;
				colvarShamDetail.DefaultSetting = @"";
				colvarShamDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarShamDetail);
				
				TableSchema.TableColumn colvarXinghuTime = new TableSchema.TableColumn(schema);
				colvarXinghuTime.ColumnName = "Xinghu_time";
				colvarXinghuTime.DataType = DbType.DateTime;
				colvarXinghuTime.MaxLength = 0;
				colvarXinghuTime.AutoIncrement = false;
				colvarXinghuTime.IsNullable = true;
				colvarXinghuTime.IsPrimaryKey = false;
				colvarXinghuTime.IsForeignKey = false;
				colvarXinghuTime.IsReadOnly = false;
				colvarXinghuTime.DefaultSetting = @"";
				colvarXinghuTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarXinghuTime);
				
				TableSchema.TableColumn colvarXinghuProject = new TableSchema.TableColumn(schema);
				colvarXinghuProject.ColumnName = "Xinghu_project";
				colvarXinghuProject.DataType = DbType.String;
				colvarXinghuProject.MaxLength = 100;
				colvarXinghuProject.AutoIncrement = false;
				colvarXinghuProject.IsNullable = true;
				colvarXinghuProject.IsPrimaryKey = false;
				colvarXinghuProject.IsForeignKey = false;
				colvarXinghuProject.IsReadOnly = false;
				colvarXinghuProject.DefaultSetting = @"";
				colvarXinghuProject.ForeignKeyTableName = "";
				schema.Columns.Add(colvarXinghuProject);
				
				TableSchema.TableColumn colvarXinghuDetail = new TableSchema.TableColumn(schema);
				colvarXinghuDetail.ColumnName = "Xinghu_detail";
				colvarXinghuDetail.DataType = DbType.String;
				colvarXinghuDetail.MaxLength = 1073741823;
				colvarXinghuDetail.AutoIncrement = false;
				colvarXinghuDetail.IsNullable = true;
				colvarXinghuDetail.IsPrimaryKey = false;
				colvarXinghuDetail.IsForeignKey = false;
				colvarXinghuDetail.IsReadOnly = false;
				colvarXinghuDetail.DefaultSetting = @"";
				colvarXinghuDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarXinghuDetail);
				
				TableSchema.TableColumn colvarContractTime = new TableSchema.TableColumn(schema);
				colvarContractTime.ColumnName = "Contract_time";
				colvarContractTime.DataType = DbType.DateTime;
				colvarContractTime.MaxLength = 0;
				colvarContractTime.AutoIncrement = false;
				colvarContractTime.IsNullable = true;
				colvarContractTime.IsPrimaryKey = false;
				colvarContractTime.IsForeignKey = false;
				colvarContractTime.IsReadOnly = false;
				colvarContractTime.DefaultSetting = @"";
				colvarContractTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarContractTime);
				
				TableSchema.TableColumn colvarContractProject = new TableSchema.TableColumn(schema);
				colvarContractProject.ColumnName = "Contract_project";
				colvarContractProject.DataType = DbType.String;
				colvarContractProject.MaxLength = 100;
				colvarContractProject.AutoIncrement = false;
				colvarContractProject.IsNullable = true;
				colvarContractProject.IsPrimaryKey = false;
				colvarContractProject.IsForeignKey = false;
				colvarContractProject.IsReadOnly = false;
				colvarContractProject.DefaultSetting = @"";
				colvarContractProject.ForeignKeyTableName = "";
				schema.Columns.Add(colvarContractProject);
				
				TableSchema.TableColumn colvarContractDetail = new TableSchema.TableColumn(schema);
				colvarContractDetail.ColumnName = "Contract_detail";
				colvarContractDetail.DataType = DbType.String;
				colvarContractDetail.MaxLength = 1073741823;
				colvarContractDetail.AutoIncrement = false;
				colvarContractDetail.IsNullable = true;
				colvarContractDetail.IsPrimaryKey = false;
				colvarContractDetail.IsForeignKey = false;
				colvarContractDetail.IsReadOnly = false;
				colvarContractDetail.DefaultSetting = @"";
				colvarContractDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarContractDetail);
				
				TableSchema.TableColumn colvarOtherDetail = new TableSchema.TableColumn(schema);
				colvarOtherDetail.ColumnName = "other_detail";
				colvarOtherDetail.DataType = DbType.String;
				colvarOtherDetail.MaxLength = 1073741823;
				colvarOtherDetail.AutoIncrement = false;
				colvarOtherDetail.IsNullable = true;
				colvarOtherDetail.IsPrimaryKey = false;
				colvarOtherDetail.IsForeignKey = false;
				colvarOtherDetail.IsReadOnly = false;
				colvarOtherDetail.DefaultSetting = @"";
				colvarOtherDetail.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOtherDetail);
				
				TableSchema.TableColumn colvarEnteringUserid = new TableSchema.TableColumn(schema);
				colvarEnteringUserid.ColumnName = "Entering_userid";
				colvarEnteringUserid.DataType = DbType.Int32;
				colvarEnteringUserid.MaxLength = 0;
				colvarEnteringUserid.AutoIncrement = false;
				colvarEnteringUserid.IsNullable = true;
				colvarEnteringUserid.IsPrimaryKey = false;
				colvarEnteringUserid.IsForeignKey = false;
				colvarEnteringUserid.IsReadOnly = false;
				colvarEnteringUserid.DefaultSetting = @"";
				colvarEnteringUserid.ForeignKeyTableName = "";
				schema.Columns.Add(colvarEnteringUserid);
				
				TableSchema.TableColumn colvarEnteringDeptID = new TableSchema.TableColumn(schema);
				colvarEnteringDeptID.ColumnName = "Entering_deptID";
				colvarEnteringDeptID.DataType = DbType.Int32;
				colvarEnteringDeptID.MaxLength = 0;
				colvarEnteringDeptID.AutoIncrement = false;
				colvarEnteringDeptID.IsNullable = true;
				colvarEnteringDeptID.IsPrimaryKey = false;
				colvarEnteringDeptID.IsForeignKey = false;
				colvarEnteringDeptID.IsReadOnly = false;
				colvarEnteringDeptID.DefaultSetting = @"";
				colvarEnteringDeptID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarEnteringDeptID);
				
				TableSchema.TableColumn colvarDeptMasterId = new TableSchema.TableColumn(schema);
				colvarDeptMasterId.ColumnName = "Dept_master_ID";
				colvarDeptMasterId.DataType = DbType.Int32;
				colvarDeptMasterId.MaxLength = 0;
				colvarDeptMasterId.AutoIncrement = false;
				colvarDeptMasterId.IsNullable = true;
				colvarDeptMasterId.IsPrimaryKey = false;
				colvarDeptMasterId.IsForeignKey = false;
				colvarDeptMasterId.IsReadOnly = false;
				colvarDeptMasterId.DefaultSetting = @"";
				colvarDeptMasterId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterId);
				
				TableSchema.TableColumn colvarDeptMasterTime = new TableSchema.TableColumn(schema);
				colvarDeptMasterTime.ColumnName = "Dept_master_time";
				colvarDeptMasterTime.DataType = DbType.DateTime;
				colvarDeptMasterTime.MaxLength = 0;
				colvarDeptMasterTime.AutoIncrement = false;
				colvarDeptMasterTime.IsNullable = true;
				colvarDeptMasterTime.IsPrimaryKey = false;
				colvarDeptMasterTime.IsForeignKey = false;
				colvarDeptMasterTime.IsReadOnly = false;
				colvarDeptMasterTime.DefaultSetting = @"";
				colvarDeptMasterTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterTime);
				
				TableSchema.TableColumn colvarDeptMasterStatus = new TableSchema.TableColumn(schema);
				colvarDeptMasterStatus.ColumnName = "Dept_master_status";
				colvarDeptMasterStatus.DataType = DbType.Int32;
				colvarDeptMasterStatus.MaxLength = 0;
				colvarDeptMasterStatus.AutoIncrement = false;
				colvarDeptMasterStatus.IsNullable = true;
				colvarDeptMasterStatus.IsPrimaryKey = false;
				colvarDeptMasterStatus.IsForeignKey = false;
				colvarDeptMasterStatus.IsReadOnly = false;
				colvarDeptMasterStatus.DefaultSetting = @"";
				colvarDeptMasterStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterStatus);
				
				TableSchema.TableColumn colvarDeptMasterRemark = new TableSchema.TableColumn(schema);
				colvarDeptMasterRemark.ColumnName = "Dept_master_remark";
				colvarDeptMasterRemark.DataType = DbType.String;
				colvarDeptMasterRemark.MaxLength = 1073741823;
				colvarDeptMasterRemark.AutoIncrement = false;
				colvarDeptMasterRemark.IsNullable = true;
				colvarDeptMasterRemark.IsPrimaryKey = false;
				colvarDeptMasterRemark.IsForeignKey = false;
				colvarDeptMasterRemark.IsReadOnly = false;
				colvarDeptMasterRemark.DefaultSetting = @"";
				colvarDeptMasterRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDeptMasterRemark);
				
				TableSchema.TableColumn colvarTechMasterId = new TableSchema.TableColumn(schema);
				colvarTechMasterId.ColumnName = "Tech_master_ID";
				colvarTechMasterId.DataType = DbType.Int32;
				colvarTechMasterId.MaxLength = 0;
				colvarTechMasterId.AutoIncrement = false;
				colvarTechMasterId.IsNullable = true;
				colvarTechMasterId.IsPrimaryKey = false;
				colvarTechMasterId.IsForeignKey = false;
				colvarTechMasterId.IsReadOnly = false;
				colvarTechMasterId.DefaultSetting = @"";
				colvarTechMasterId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTechMasterId);
				
				TableSchema.TableColumn colvarTechMasterTime = new TableSchema.TableColumn(schema);
				colvarTechMasterTime.ColumnName = "Tech_master_time";
				colvarTechMasterTime.DataType = DbType.DateTime;
				colvarTechMasterTime.MaxLength = 0;
				colvarTechMasterTime.AutoIncrement = false;
				colvarTechMasterTime.IsNullable = true;
				colvarTechMasterTime.IsPrimaryKey = false;
				colvarTechMasterTime.IsForeignKey = false;
				colvarTechMasterTime.IsReadOnly = false;
				colvarTechMasterTime.DefaultSetting = @"";
				colvarTechMasterTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTechMasterTime);
				
				TableSchema.TableColumn colvarTechMasterStatus = new TableSchema.TableColumn(schema);
				colvarTechMasterStatus.ColumnName = "Tech_master_status";
				colvarTechMasterStatus.DataType = DbType.Int32;
				colvarTechMasterStatus.MaxLength = 0;
				colvarTechMasterStatus.AutoIncrement = false;
				colvarTechMasterStatus.IsNullable = true;
				colvarTechMasterStatus.IsPrimaryKey = false;
				colvarTechMasterStatus.IsForeignKey = false;
				colvarTechMasterStatus.IsReadOnly = false;
				colvarTechMasterStatus.DefaultSetting = @"";
				colvarTechMasterStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTechMasterStatus);
				
				TableSchema.TableColumn colvarTechMasterRemark = new TableSchema.TableColumn(schema);
				colvarTechMasterRemark.ColumnName = "Tech_master_remark";
				colvarTechMasterRemark.DataType = DbType.String;
				colvarTechMasterRemark.MaxLength = 1073741823;
				colvarTechMasterRemark.AutoIncrement = false;
				colvarTechMasterRemark.IsNullable = true;
				colvarTechMasterRemark.IsPrimaryKey = false;
				colvarTechMasterRemark.IsForeignKey = false;
				colvarTechMasterRemark.IsReadOnly = false;
				colvarTechMasterRemark.DefaultSetting = @"";
				colvarTechMasterRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTechMasterRemark);
				
				TableSchema.TableColumn colvarOfficeMasterId = new TableSchema.TableColumn(schema);
				colvarOfficeMasterId.ColumnName = "Office_master_ID";
				colvarOfficeMasterId.DataType = DbType.Int32;
				colvarOfficeMasterId.MaxLength = 0;
				colvarOfficeMasterId.AutoIncrement = false;
				colvarOfficeMasterId.IsNullable = true;
				colvarOfficeMasterId.IsPrimaryKey = false;
				colvarOfficeMasterId.IsForeignKey = false;
				colvarOfficeMasterId.IsReadOnly = false;
				colvarOfficeMasterId.DefaultSetting = @"";
				colvarOfficeMasterId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOfficeMasterId);
				
				TableSchema.TableColumn colvarOfficeMasterTime = new TableSchema.TableColumn(schema);
				colvarOfficeMasterTime.ColumnName = "Office_master_time";
				colvarOfficeMasterTime.DataType = DbType.DateTime;
				colvarOfficeMasterTime.MaxLength = 0;
				colvarOfficeMasterTime.AutoIncrement = false;
				colvarOfficeMasterTime.IsNullable = true;
				colvarOfficeMasterTime.IsPrimaryKey = false;
				colvarOfficeMasterTime.IsForeignKey = false;
				colvarOfficeMasterTime.IsReadOnly = false;
				colvarOfficeMasterTime.DefaultSetting = @"";
				colvarOfficeMasterTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOfficeMasterTime);
				
				TableSchema.TableColumn colvarOfficeMasterStatus = new TableSchema.TableColumn(schema);
				colvarOfficeMasterStatus.ColumnName = "Office_master_status";
				colvarOfficeMasterStatus.DataType = DbType.Int32;
				colvarOfficeMasterStatus.MaxLength = 0;
				colvarOfficeMasterStatus.AutoIncrement = false;
				colvarOfficeMasterStatus.IsNullable = true;
				colvarOfficeMasterStatus.IsPrimaryKey = false;
				colvarOfficeMasterStatus.IsForeignKey = false;
				colvarOfficeMasterStatus.IsReadOnly = false;
				colvarOfficeMasterStatus.DefaultSetting = @"";
				colvarOfficeMasterStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOfficeMasterStatus);
				
				TableSchema.TableColumn colvarOfficeMasterRemark = new TableSchema.TableColumn(schema);
				colvarOfficeMasterRemark.ColumnName = "Office_master_remark";
				colvarOfficeMasterRemark.DataType = DbType.String;
				colvarOfficeMasterRemark.MaxLength = 1073741823;
				colvarOfficeMasterRemark.AutoIncrement = false;
				colvarOfficeMasterRemark.IsNullable = true;
				colvarOfficeMasterRemark.IsPrimaryKey = false;
				colvarOfficeMasterRemark.IsForeignKey = false;
				colvarOfficeMasterRemark.IsReadOnly = false;
				colvarOfficeMasterRemark.DefaultSetting = @"";
				colvarOfficeMasterRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarOfficeMasterRemark);
				
				TableSchema.TableColumn colvarBossId = new TableSchema.TableColumn(schema);
				colvarBossId.ColumnName = "Boss_ID";
				colvarBossId.DataType = DbType.Int32;
				colvarBossId.MaxLength = 0;
				colvarBossId.AutoIncrement = false;
				colvarBossId.IsNullable = true;
				colvarBossId.IsPrimaryKey = false;
				colvarBossId.IsForeignKey = false;
				colvarBossId.IsReadOnly = false;
				colvarBossId.DefaultSetting = @"";
				colvarBossId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossId);
				
				TableSchema.TableColumn colvarBossTime = new TableSchema.TableColumn(schema);
				colvarBossTime.ColumnName = "Boss_time";
				colvarBossTime.DataType = DbType.DateTime;
				colvarBossTime.MaxLength = 0;
				colvarBossTime.AutoIncrement = false;
				colvarBossTime.IsNullable = true;
				colvarBossTime.IsPrimaryKey = false;
				colvarBossTime.IsForeignKey = false;
				colvarBossTime.IsReadOnly = false;
				colvarBossTime.DefaultSetting = @"";
				colvarBossTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossTime);
				
				TableSchema.TableColumn colvarBossStatus = new TableSchema.TableColumn(schema);
				colvarBossStatus.ColumnName = "Boss_status";
				colvarBossStatus.DataType = DbType.Int32;
				colvarBossStatus.MaxLength = 0;
				colvarBossStatus.AutoIncrement = false;
				colvarBossStatus.IsNullable = true;
				colvarBossStatus.IsPrimaryKey = false;
				colvarBossStatus.IsForeignKey = false;
				colvarBossStatus.IsReadOnly = false;
				colvarBossStatus.DefaultSetting = @"";
				colvarBossStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossStatus);
				
				TableSchema.TableColumn colvarBossRemark = new TableSchema.TableColumn(schema);
				colvarBossRemark.ColumnName = "Boss_remark";
				colvarBossRemark.DataType = DbType.String;
				colvarBossRemark.MaxLength = 1073741823;
				colvarBossRemark.AutoIncrement = false;
				colvarBossRemark.IsNullable = true;
				colvarBossRemark.IsPrimaryKey = false;
				colvarBossRemark.IsForeignKey = false;
				colvarBossRemark.IsReadOnly = false;
				colvarBossRemark.DefaultSetting = @"";
				colvarBossRemark.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBossRemark);
				
				TableSchema.TableColumn colvarInTime = new TableSchema.TableColumn(schema);
				colvarInTime.ColumnName = "inTime";
				colvarInTime.DataType = DbType.DateTime;
				colvarInTime.MaxLength = 0;
				colvarInTime.AutoIncrement = false;
				colvarInTime.IsNullable = true;
				colvarInTime.IsPrimaryKey = false;
				colvarInTime.IsForeignKey = false;
				colvarInTime.IsReadOnly = false;
				
						colvarInTime.DefaultSetting = @"(getdate())";
				colvarInTime.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInTime);
				
				TableSchema.TableColumn colvarGuid = new TableSchema.TableColumn(schema);
				colvarGuid.ColumnName = "Guid";
				colvarGuid.DataType = DbType.Guid;
				colvarGuid.MaxLength = 0;
				colvarGuid.AutoIncrement = false;
				colvarGuid.IsNullable = true;
				colvarGuid.IsPrimaryKey = false;
				colvarGuid.IsForeignKey = false;
				colvarGuid.IsReadOnly = false;
				colvarGuid.DefaultSetting = @"";
				colvarGuid.ForeignKeyTableName = "";
				schema.Columns.Add(colvarGuid);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["CXDB"].AddSchema("CX_Provider",schema);
			}
		}
		#endregion
		
		#region Props
		  
		[XmlAttribute("Id")]
		[Bindable(true)]
		public int Id 
		{
			get { return GetColumnValue<int>(Columns.Id); }
			set { SetColumnValue(Columns.Id, value); }
		}
		  
		[XmlAttribute("ProviderName")]
		[Bindable(true)]
		public string ProviderName 
		{
			get { return GetColumnValue<string>(Columns.ProviderName); }
			set { SetColumnValue(Columns.ProviderName, value); }
		}
		  
		[XmlAttribute("DeviceName")]
		[Bindable(true)]
		public string DeviceName 
		{
			get { return GetColumnValue<string>(Columns.DeviceName); }
			set { SetColumnValue(Columns.DeviceName, value); }
		}
		  
		[XmlAttribute("ShamTime")]
		[Bindable(true)]
		public DateTime? ShamTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.ShamTime); }
			set { SetColumnValue(Columns.ShamTime, value); }
		}
		  
		[XmlAttribute("ShamProject")]
		[Bindable(true)]
		public string ShamProject 
		{
			get { return GetColumnValue<string>(Columns.ShamProject); }
			set { SetColumnValue(Columns.ShamProject, value); }
		}
		  
		[XmlAttribute("ShamDetail")]
		[Bindable(true)]
		public string ShamDetail 
		{
			get { return GetColumnValue<string>(Columns.ShamDetail); }
			set { SetColumnValue(Columns.ShamDetail, value); }
		}
		  
		[XmlAttribute("XinghuTime")]
		[Bindable(true)]
		public DateTime? XinghuTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.XinghuTime); }
			set { SetColumnValue(Columns.XinghuTime, value); }
		}
		  
		[XmlAttribute("XinghuProject")]
		[Bindable(true)]
		public string XinghuProject 
		{
			get { return GetColumnValue<string>(Columns.XinghuProject); }
			set { SetColumnValue(Columns.XinghuProject, value); }
		}
		  
		[XmlAttribute("XinghuDetail")]
		[Bindable(true)]
		public string XinghuDetail 
		{
			get { return GetColumnValue<string>(Columns.XinghuDetail); }
			set { SetColumnValue(Columns.XinghuDetail, value); }
		}
		  
		[XmlAttribute("ContractTime")]
		[Bindable(true)]
		public DateTime? ContractTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.ContractTime); }
			set { SetColumnValue(Columns.ContractTime, value); }
		}
		  
		[XmlAttribute("ContractProject")]
		[Bindable(true)]
		public string ContractProject 
		{
			get { return GetColumnValue<string>(Columns.ContractProject); }
			set { SetColumnValue(Columns.ContractProject, value); }
		}
		  
		[XmlAttribute("ContractDetail")]
		[Bindable(true)]
		public string ContractDetail 
		{
			get { return GetColumnValue<string>(Columns.ContractDetail); }
			set { SetColumnValue(Columns.ContractDetail, value); }
		}
		  
		[XmlAttribute("OtherDetail")]
		[Bindable(true)]
		public string OtherDetail 
		{
			get { return GetColumnValue<string>(Columns.OtherDetail); }
			set { SetColumnValue(Columns.OtherDetail, value); }
		}
		  
		[XmlAttribute("EnteringUserid")]
		[Bindable(true)]
		public int? EnteringUserid 
		{
			get { return GetColumnValue<int?>(Columns.EnteringUserid); }
			set { SetColumnValue(Columns.EnteringUserid, value); }
		}
		  
		[XmlAttribute("EnteringDeptID")]
		[Bindable(true)]
		public int? EnteringDeptID 
		{
			get { return GetColumnValue<int?>(Columns.EnteringDeptID); }
			set { SetColumnValue(Columns.EnteringDeptID, value); }
		}
		  
		[XmlAttribute("DeptMasterId")]
		[Bindable(true)]
		public int? DeptMasterId 
		{
			get { return GetColumnValue<int?>(Columns.DeptMasterId); }
			set { SetColumnValue(Columns.DeptMasterId, value); }
		}
		  
		[XmlAttribute("DeptMasterTime")]
		[Bindable(true)]
		public DateTime? DeptMasterTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.DeptMasterTime); }
			set { SetColumnValue(Columns.DeptMasterTime, value); }
		}
		  
		[XmlAttribute("DeptMasterStatus")]
		[Bindable(true)]
		public int? DeptMasterStatus 
		{
			get { return GetColumnValue<int?>(Columns.DeptMasterStatus); }
			set { SetColumnValue(Columns.DeptMasterStatus, value); }
		}
		  
		[XmlAttribute("DeptMasterRemark")]
		[Bindable(true)]
		public string DeptMasterRemark 
		{
			get { return GetColumnValue<string>(Columns.DeptMasterRemark); }
			set { SetColumnValue(Columns.DeptMasterRemark, value); }
		}
		  
		[XmlAttribute("TechMasterId")]
		[Bindable(true)]
		public int? TechMasterId 
		{
			get { return GetColumnValue<int?>(Columns.TechMasterId); }
			set { SetColumnValue(Columns.TechMasterId, value); }
		}
		  
		[XmlAttribute("TechMasterTime")]
		[Bindable(true)]
		public DateTime? TechMasterTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.TechMasterTime); }
			set { SetColumnValue(Columns.TechMasterTime, value); }
		}
		  
		[XmlAttribute("TechMasterStatus")]
		[Bindable(true)]
		public int? TechMasterStatus 
		{
			get { return GetColumnValue<int?>(Columns.TechMasterStatus); }
			set { SetColumnValue(Columns.TechMasterStatus, value); }
		}
		  
		[XmlAttribute("TechMasterRemark")]
		[Bindable(true)]
		public string TechMasterRemark 
		{
			get { return GetColumnValue<string>(Columns.TechMasterRemark); }
			set { SetColumnValue(Columns.TechMasterRemark, value); }
		}
		  
		[XmlAttribute("OfficeMasterId")]
		[Bindable(true)]
		public int? OfficeMasterId 
		{
			get { return GetColumnValue<int?>(Columns.OfficeMasterId); }
			set { SetColumnValue(Columns.OfficeMasterId, value); }
		}
		  
		[XmlAttribute("OfficeMasterTime")]
		[Bindable(true)]
		public DateTime? OfficeMasterTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.OfficeMasterTime); }
			set { SetColumnValue(Columns.OfficeMasterTime, value); }
		}
		  
		[XmlAttribute("OfficeMasterStatus")]
		[Bindable(true)]
		public int? OfficeMasterStatus 
		{
			get { return GetColumnValue<int?>(Columns.OfficeMasterStatus); }
			set { SetColumnValue(Columns.OfficeMasterStatus, value); }
		}
		  
		[XmlAttribute("OfficeMasterRemark")]
		[Bindable(true)]
		public string OfficeMasterRemark 
		{
			get { return GetColumnValue<string>(Columns.OfficeMasterRemark); }
			set { SetColumnValue(Columns.OfficeMasterRemark, value); }
		}
		  
		[XmlAttribute("BossId")]
		[Bindable(true)]
		public int? BossId 
		{
			get { return GetColumnValue<int?>(Columns.BossId); }
			set { SetColumnValue(Columns.BossId, value); }
		}
		  
		[XmlAttribute("BossTime")]
		[Bindable(true)]
		public DateTime? BossTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.BossTime); }
			set { SetColumnValue(Columns.BossTime, value); }
		}
		  
		[XmlAttribute("BossStatus")]
		[Bindable(true)]
		public int? BossStatus 
		{
			get { return GetColumnValue<int?>(Columns.BossStatus); }
			set { SetColumnValue(Columns.BossStatus, value); }
		}
		  
		[XmlAttribute("BossRemark")]
		[Bindable(true)]
		public string BossRemark 
		{
			get { return GetColumnValue<string>(Columns.BossRemark); }
			set { SetColumnValue(Columns.BossRemark, value); }
		}
		  
		[XmlAttribute("InTime")]
		[Bindable(true)]
		public DateTime? InTime 
		{
			get { return GetColumnValue<DateTime?>(Columns.InTime); }
			set { SetColumnValue(Columns.InTime, value); }
		}
		  
		[XmlAttribute("Guid")]
		[Bindable(true)]
		public Guid? Guid 
		{
			get { return GetColumnValue<Guid?>(Columns.Guid); }
			set { SetColumnValue(Columns.Guid, value); }
		}
		
		#endregion
		
		
			
		
		//no foreign key tables defined (0)
		
		
		
		//no ManyToMany tables defined (0)
		
        
        
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(string varProviderName,string varDeviceName,DateTime? varShamTime,string varShamProject,string varShamDetail,DateTime? varXinghuTime,string varXinghuProject,string varXinghuDetail,DateTime? varContractTime,string varContractProject,string varContractDetail,string varOtherDetail,int? varEnteringUserid,int? varEnteringDeptID,int? varDeptMasterId,DateTime? varDeptMasterTime,int? varDeptMasterStatus,string varDeptMasterRemark,int? varTechMasterId,DateTime? varTechMasterTime,int? varTechMasterStatus,string varTechMasterRemark,int? varOfficeMasterId,DateTime? varOfficeMasterTime,int? varOfficeMasterStatus,string varOfficeMasterRemark,int? varBossId,DateTime? varBossTime,int? varBossStatus,string varBossRemark,DateTime? varInTime,Guid? varGuid)
		{
			CxProvider item = new CxProvider();
			
			item.ProviderName = varProviderName;
			
			item.DeviceName = varDeviceName;
			
			item.ShamTime = varShamTime;
			
			item.ShamProject = varShamProject;
			
			item.ShamDetail = varShamDetail;
			
			item.XinghuTime = varXinghuTime;
			
			item.XinghuProject = varXinghuProject;
			
			item.XinghuDetail = varXinghuDetail;
			
			item.ContractTime = varContractTime;
			
			item.ContractProject = varContractProject;
			
			item.ContractDetail = varContractDetail;
			
			item.OtherDetail = varOtherDetail;
			
			item.EnteringUserid = varEnteringUserid;
			
			item.EnteringDeptID = varEnteringDeptID;
			
			item.DeptMasterId = varDeptMasterId;
			
			item.DeptMasterTime = varDeptMasterTime;
			
			item.DeptMasterStatus = varDeptMasterStatus;
			
			item.DeptMasterRemark = varDeptMasterRemark;
			
			item.TechMasterId = varTechMasterId;
			
			item.TechMasterTime = varTechMasterTime;
			
			item.TechMasterStatus = varTechMasterStatus;
			
			item.TechMasterRemark = varTechMasterRemark;
			
			item.OfficeMasterId = varOfficeMasterId;
			
			item.OfficeMasterTime = varOfficeMasterTime;
			
			item.OfficeMasterStatus = varOfficeMasterStatus;
			
			item.OfficeMasterRemark = varOfficeMasterRemark;
			
			item.BossId = varBossId;
			
			item.BossTime = varBossTime;
			
			item.BossStatus = varBossStatus;
			
			item.BossRemark = varBossRemark;
			
			item.InTime = varInTime;
			
			item.Guid = varGuid;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varId,string varProviderName,string varDeviceName,DateTime? varShamTime,string varShamProject,string varShamDetail,DateTime? varXinghuTime,string varXinghuProject,string varXinghuDetail,DateTime? varContractTime,string varContractProject,string varContractDetail,string varOtherDetail,int? varEnteringUserid,int? varEnteringDeptID,int? varDeptMasterId,DateTime? varDeptMasterTime,int? varDeptMasterStatus,string varDeptMasterRemark,int? varTechMasterId,DateTime? varTechMasterTime,int? varTechMasterStatus,string varTechMasterRemark,int? varOfficeMasterId,DateTime? varOfficeMasterTime,int? varOfficeMasterStatus,string varOfficeMasterRemark,int? varBossId,DateTime? varBossTime,int? varBossStatus,string varBossRemark,DateTime? varInTime,Guid? varGuid)
		{
			CxProvider item = new CxProvider();
			
				item.Id = varId;
			
				item.ProviderName = varProviderName;
			
				item.DeviceName = varDeviceName;
			
				item.ShamTime = varShamTime;
			
				item.ShamProject = varShamProject;
			
				item.ShamDetail = varShamDetail;
			
				item.XinghuTime = varXinghuTime;
			
				item.XinghuProject = varXinghuProject;
			
				item.XinghuDetail = varXinghuDetail;
			
				item.ContractTime = varContractTime;
			
				item.ContractProject = varContractProject;
			
				item.ContractDetail = varContractDetail;
			
				item.OtherDetail = varOtherDetail;
			
				item.EnteringUserid = varEnteringUserid;
			
				item.EnteringDeptID = varEnteringDeptID;
			
				item.DeptMasterId = varDeptMasterId;
			
				item.DeptMasterTime = varDeptMasterTime;
			
				item.DeptMasterStatus = varDeptMasterStatus;
			
				item.DeptMasterRemark = varDeptMasterRemark;
			
				item.TechMasterId = varTechMasterId;
			
				item.TechMasterTime = varTechMasterTime;
			
				item.TechMasterStatus = varTechMasterStatus;
			
				item.TechMasterRemark = varTechMasterRemark;
			
				item.OfficeMasterId = varOfficeMasterId;
			
				item.OfficeMasterTime = varOfficeMasterTime;
			
				item.OfficeMasterStatus = varOfficeMasterStatus;
			
				item.OfficeMasterRemark = varOfficeMasterRemark;
			
				item.BossId = varBossId;
			
				item.BossTime = varBossTime;
			
				item.BossStatus = varBossStatus;
			
				item.BossRemark = varBossRemark;
			
				item.InTime = varInTime;
			
				item.Guid = varGuid;
			
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion
        
        
        
        #region Typed Columns
        
        
        public static TableSchema.TableColumn IdColumn
        {
            get { return Schema.Columns[0]; }
        }
        
        
        
        public static TableSchema.TableColumn ProviderNameColumn
        {
            get { return Schema.Columns[1]; }
        }
        
        
        
        public static TableSchema.TableColumn DeviceNameColumn
        {
            get { return Schema.Columns[2]; }
        }
        
        
        
        public static TableSchema.TableColumn ShamTimeColumn
        {
            get { return Schema.Columns[3]; }
        }
        
        
        
        public static TableSchema.TableColumn ShamProjectColumn
        {
            get { return Schema.Columns[4]; }
        }
        
        
        
        public static TableSchema.TableColumn ShamDetailColumn
        {
            get { return Schema.Columns[5]; }
        }
        
        
        
        public static TableSchema.TableColumn XinghuTimeColumn
        {
            get { return Schema.Columns[6]; }
        }
        
        
        
        public static TableSchema.TableColumn XinghuProjectColumn
        {
            get { return Schema.Columns[7]; }
        }
        
        
        
        public static TableSchema.TableColumn XinghuDetailColumn
        {
            get { return Schema.Columns[8]; }
        }
        
        
        
        public static TableSchema.TableColumn ContractTimeColumn
        {
            get { return Schema.Columns[9]; }
        }
        
        
        
        public static TableSchema.TableColumn ContractProjectColumn
        {
            get { return Schema.Columns[10]; }
        }
        
        
        
        public static TableSchema.TableColumn ContractDetailColumn
        {
            get { return Schema.Columns[11]; }
        }
        
        
        
        public static TableSchema.TableColumn OtherDetailColumn
        {
            get { return Schema.Columns[12]; }
        }
        
        
        
        public static TableSchema.TableColumn EnteringUseridColumn
        {
            get { return Schema.Columns[13]; }
        }
        
        
        
        public static TableSchema.TableColumn EnteringDeptIDColumn
        {
            get { return Schema.Columns[14]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterIdColumn
        {
            get { return Schema.Columns[15]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterTimeColumn
        {
            get { return Schema.Columns[16]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterStatusColumn
        {
            get { return Schema.Columns[17]; }
        }
        
        
        
        public static TableSchema.TableColumn DeptMasterRemarkColumn
        {
            get { return Schema.Columns[18]; }
        }
        
        
        
        public static TableSchema.TableColumn TechMasterIdColumn
        {
            get { return Schema.Columns[19]; }
        }
        
        
        
        public static TableSchema.TableColumn TechMasterTimeColumn
        {
            get { return Schema.Columns[20]; }
        }
        
        
        
        public static TableSchema.TableColumn TechMasterStatusColumn
        {
            get { return Schema.Columns[21]; }
        }
        
        
        
        public static TableSchema.TableColumn TechMasterRemarkColumn
        {
            get { return Schema.Columns[22]; }
        }
        
        
        
        public static TableSchema.TableColumn OfficeMasterIdColumn
        {
            get { return Schema.Columns[23]; }
        }
        
        
        
        public static TableSchema.TableColumn OfficeMasterTimeColumn
        {
            get { return Schema.Columns[24]; }
        }
        
        
        
        public static TableSchema.TableColumn OfficeMasterStatusColumn
        {
            get { return Schema.Columns[25]; }
        }
        
        
        
        public static TableSchema.TableColumn OfficeMasterRemarkColumn
        {
            get { return Schema.Columns[26]; }
        }
        
        
        
        public static TableSchema.TableColumn BossIdColumn
        {
            get { return Schema.Columns[27]; }
        }
        
        
        
        public static TableSchema.TableColumn BossTimeColumn
        {
            get { return Schema.Columns[28]; }
        }
        
        
        
        public static TableSchema.TableColumn BossStatusColumn
        {
            get { return Schema.Columns[29]; }
        }
        
        
        
        public static TableSchema.TableColumn BossRemarkColumn
        {
            get { return Schema.Columns[30]; }
        }
        
        
        
        public static TableSchema.TableColumn InTimeColumn
        {
            get { return Schema.Columns[31]; }
        }
        
        
        
        public static TableSchema.TableColumn GuidColumn
        {
            get { return Schema.Columns[32]; }
        }
        
        
        
        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string Id = @"ID";
			 public static string ProviderName = @"ProviderName";
			 public static string DeviceName = @"DeviceName";
			 public static string ShamTime = @"Sham_time";
			 public static string ShamProject = @"Sham_project";
			 public static string ShamDetail = @"Sham_detail";
			 public static string XinghuTime = @"Xinghu_time";
			 public static string XinghuProject = @"Xinghu_project";
			 public static string XinghuDetail = @"Xinghu_detail";
			 public static string ContractTime = @"Contract_time";
			 public static string ContractProject = @"Contract_project";
			 public static string ContractDetail = @"Contract_detail";
			 public static string OtherDetail = @"other_detail";
			 public static string EnteringUserid = @"Entering_userid";
			 public static string EnteringDeptID = @"Entering_deptID";
			 public static string DeptMasterId = @"Dept_master_ID";
			 public static string DeptMasterTime = @"Dept_master_time";
			 public static string DeptMasterStatus = @"Dept_master_status";
			 public static string DeptMasterRemark = @"Dept_master_remark";
			 public static string TechMasterId = @"Tech_master_ID";
			 public static string TechMasterTime = @"Tech_master_time";
			 public static string TechMasterStatus = @"Tech_master_status";
			 public static string TechMasterRemark = @"Tech_master_remark";
			 public static string OfficeMasterId = @"Office_master_ID";
			 public static string OfficeMasterTime = @"Office_master_time";
			 public static string OfficeMasterStatus = @"Office_master_status";
			 public static string OfficeMasterRemark = @"Office_master_remark";
			 public static string BossId = @"Boss_ID";
			 public static string BossTime = @"Boss_time";
			 public static string BossStatus = @"Boss_status";
			 public static string BossRemark = @"Boss_remark";
			 public static string InTime = @"inTime";
			 public static string Guid = @"Guid";
						
		}
		#endregion
		
		#region Update PK Collections
		
        #endregion
    
        #region Deep Save
		
        #endregion
	}
}
